package demo.proxy.staticc;

import demo.proxy.target.ToCPay;

public class ToCPayProxy implements ToCPay {
    ToCPay target;

    public ToCPayProxy(ToCPay target) {
        this.target = target;
    }

    @Override
    public void pay() {
        before();
        target.pay();
        after();
    }

    private void before() {
        System.out.println("支付之前的操作");
    }
    private void after() {
        System.out.println("支付之后的操作");
    }
}
